/**
  ETFRoot project, Anyang Normal University && IMP-CAS
  \class ETFPIDManager
  \brief to manage particle identification (PID) objects in ETFAna
  \author SUN Yazhou, asia.rabbit@163.com
  \since 2021-12-13
  \date 2021-12-13 last modified
  \attention
  changelog
  <table>
  <tr>  <th>Date         <th>Author      <th>Description                   </tr>
  <tr>  <td>2021-12-13   <td>Asia Sun    <td>file created                  </tr>
  </table>

  \copyright Copyright (c) 2021 Anyang Normal U. && IMP-CAS with LGPLv3 LICENSE
*/

#include "FairRootManager.h"
#include "ETFPIDManager.h"
#include "ETFPID.h"

ETFPIDManager *ETFPIDManager::fInstance = nullptr;

ETFPIDManager::ETFPIDManager() : fPID(nullptr){}

ETFPIDManager *ETFPIDManager::Instance(){
  if(!fInstance) fInstance = new ETFPIDManager();
  return fInstance;
} // end member function fInstance

ETFPIDManager::~ETFPIDManager(){}

void ETFPIDManager::Register(){
  FairRootManager::Instance()->Register("pid", "PID", GetPID(), true);
} // end member function Register

ETFPID *ETFPIDManager::GetPID(){
  if(!fPID) fPID = new ETFPID();
  return fPID;
} // end member function GetPID
